#pragma once

#include "Subject.h"

class TimeManager : public ZeEngine::Subject
{
public:
    TimeManager();
    ~TimeManager();

    void Start();
    void Pause();
    void UpdateClock(u32 deltaMS);
    void ToggleStartPause();
    void IncreaseSpeed();
    void DecreaseSpeed();

    inline s32 GetSpeedMultiplier() const { return m_increment; }

    const std::string ToString() const;

    inline u32 GetElapsedDays() const
    {
        return m_daysPassed;
    }

    inline u32 GetHours() const
	{
		return (int)(m_runningClock / 3600.0f);
	}
	
    inline u32 GetMinutes() const
	{
		return (int)(m_runningClock / 60.0f) % 60;
	}
	
    inline u32 GetSeconds() const
	{
		 return (int)m_runningClock % 60;
	}

    inline bool IsPaused() const
    {
        return m_paused;
    }

private:
    bool m_paused;
    f32  m_runningClock;
    s32  m_increment;
    u32  m_daysPassed;

    static const u32 cSmudgeFactor;
    static const u32 cMaxSmudgeFactor;
};

